From: Ben Hutchings Date: Mon, 27 Nov 2017 20:49:07 +0000 (+0000) Subject: s390/mm: Avoid ABI change in 4.9.52 X-Git-Tag: archive/raspbian/4.9.80-2+rpi1~8^2~16 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/success/%22http:/www.example.com/cgi/success?a=commitdiff_plain;h=47a80efff06c2a92aa826bac110a8b3304e0690b;p=linux-4.9.git s390/mm: Avoid ABI change in 4.9.52 Commit 60f07c8ec5fa "s390/mm: fix race on mm->context.flush_mm" added a field to the s390 definition of mm_context_t. This is embedded in the arch-indepdendent struct mm_struct, so adding a new field results in an incompatible change to the layout of the larger struct. Move the new field out of mm_context_t to the end of mm_struct, and hide the change from genksyms. Gbp-Pq: Topic debian Gbp-Pq: Name s390-mm-avoid-abi-change-in-4.9.52.patch --- diff --git a/arch/s390/include/asm/mmu.h b/arch/s390/include/asm/mmu.h index af85d6b12028..8dac31f56df9 100644 --- a/arch/s390/include/asm/mmu.h +++ b/arch/s390/include/asm/mmu.h @@ -5,7 +5,6 @@ #include typedef struct { - spinlock_t lock; cpumask_t cpu_attach_mask; atomic_t flush_count; unsigned int flush_mm; @@ -26,7 +25,7 @@ typedef struct { } mm_context_t; #define INIT_MM_CONTEXT(name) \ - .context.lock = __SPIN_LOCK_UNLOCKED(name.context.lock), \ + .s390_flush_lock = __SPIN_LOCK_UNLOCKED(name.s390_flush_lock), \ .context.pgtable_lock = \ __SPIN_LOCK_UNLOCKED(name.context.pgtable_lock), \ .context.pgtable_list = LIST_HEAD_INIT(name.context.pgtable_list), \ diff --git a/arch/s390/include/asm/mmu_context.h b/arch/s390/include/asm/mmu_context.h index f65a708ac395..dee12239a36f 100644 --- a/arch/s390/include/asm/mmu_context.h +++ b/arch/s390/include/asm/mmu_context.h @@ -15,7 +15,7 @@ static inline int init_new_context(struct task_struct *tsk, struct mm_struct *mm) { - spin_lock_init(&mm->context.lock); + spin_lock_init(&mm->s390_flush_lock); spin_lock_init(&mm->context.pgtable_lock); INIT_LIST_HEAD(&mm->context.pgtable_list); spin_lock_init(&mm->context.gmap_lock); diff --git a/arch/s390/include/asm/tlbflush.h b/arch/s390/include/asm/tlbflush.h index eed927aeb08f..7ddd9824ffd7 100644 --- a/arch/s390/include/asm/tlbflush.h +++ b/arch/s390/include/asm/tlbflush.h @@ -96,12 +96,12 @@ static inline void __tlb_flush_kernel(void) static inline void __tlb_flush_mm_lazy(struct mm_struct * mm) { - spin_lock(&mm->context.lock); + spin_lock(&mm->s390_flush_lock); if (mm->context.flush_mm) { mm->context.flush_mm = 0; __tlb_flush_mm(mm); } - spin_unlock(&mm->context.lock); + spin_unlock(&mm->s390_flush_lock); } /* diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h index 6616107518ad..fd22e5f9732f 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h @@ -523,6 +523,12 @@ struct mm_struct { atomic_long_t hugetlb_usage; #endif struct work_struct async_put_work; +#ifndef __GENKSYMS__ +#ifdef CONFIG_S390 + /* bwh: This should be in s390's mm_context_t but that breaks ABI */ + spinlock_t s390_flush_lock; +#endif +#endif }; static inline void mm_init_cpumask(struct mm_struct *mm)